Skip to contentSkip to conversation

Change in openvpn[master]: zeroize struct image in packet_id_persist_save() before writing to disk

Openvpn-devel In review cron2 (Code Review) 2 participants 6 messages Oct 28, 2025 – Oct 29, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1761676579000.I7f4c7b0ca748975defca1e5104e7077a761cd49c@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email

to review the following change.

Change subject: zeroize struct image in packet_id_persist_save() before writing to disk
......................................................................

zeroize struct image in packet_id_persist_save() before writing to disk

while this really is only a debug function, ensuring that no uninitialized heap content ends up in padding in the structure and thus to disk is good practice.

Change-Id I7f4c7b0ca748975defca1e5104e7077a761cd49c

---
M src/openvpn/packet_id.c

1 file changed, 1 insertion(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/1323/1

src/openvpn/packet_id.c +1 -0
index 880eee1..08d9d9b 100644
@@ -511,6 +511,7 @@
         && (p->time != p->time_last_written || p->id != p->id_last_written))
     {
         struct packet_id_persist_file_image image;
+        CLEAR(image);
         ssize_t n;
         off_t seek_ret;
         struct gc_arena gc = gc_new();

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7f4c7b0ca748975defca1e5104e7077a761cd49c
Gerrit-Change-Number: 1323
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: cron2, plaisthos.

flichtenheld has posted comments on this change by cron2. ( http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email )

Change subject: zeroize struct image in packet_id_persist_save() before writing to disk
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7f4c7b0ca748975defca1e5104e7077a761cd49c
Gerrit-Change-Number: 1323
Gerrit-PatchSet: 1
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Comment-Date: Tue, 28 Oct 2025 19:51:04 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 zeroize struct image in packet_id_persist_save() before writing to disk

In reply to a message not in the archive

while this really is only a debug function, ensuring that no uninitialized heap content ends up in padding in the structure and thus to disk is good practice.

Change-Id I7f4c7b0ca748975defca1e5104e7077a761cd49c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1323
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1323
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

src/openvpn/packet_id.c +1 -0
index 880eee1..08d9d9b 100644
@@ -511,6 +511,7 @@
         && (p->time != p->time_last_written || p->id != p->id_last_written))
     {
         struct packet_id_persist_file_image image;
+        CLEAR(image);
         ssize_t n;
         off_t seek_ret;
         struct gc_arena gc = gc_new();
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: zeroize struct image in packet_id_persist_save() before writing to disk

Not the most critical path, but "initialize data structures before using" is considered good practice :-) - BB is also happy with it.

Patch has been applied to the master branch.

commit c58b6e73c3508b40b3d2f26eebfc3aa4df53e524

Author: Gert Doering
Date:   Tue Oct 28 21:31:50 2025 +0100
     zeroize struct image in packet_id_persist_save() before writing to disk

     Signed-off-by: Gert Doering <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1323
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg33983.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

Hello flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: zeroize struct image in packet_id_persist_save() before writing to disk
......................................................................

zeroize struct image in packet_id_persist_save() before writing to disk

while this really is only a debug function, ensuring that no uninitialized heap content ends up in padding in the structure and thus to disk is good practice.

Change-Id I7f4c7b0ca748975defca1e5104e7077a761cd49c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1323
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33983.html

---
M src/openvpn/packet_id.c

1 file changed, 1 insertion(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/23/1323/2

src/openvpn/packet_id.c +1 -0
index 880eee1..08d9d9b 100644
@@ -511,6 +511,7 @@
         && (p->time != p->time_last_written || p->id != p->id_last_written))
     {
         struct packet_id_persist_file_image image;
+        CLEAR(image);
         ssize_t n;
         off_t seek_ret;
         struct gc_arena gc = gc_new();

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7f4c7b0ca748975defca1e5104e7077a761cd49c
Gerrit-Change-Number: 1323
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email )

Change subject: zeroize struct image in packet_id_persist_save() before writing to disk
......................................................................

zeroize struct image in packet_id_persist_save() before writing to disk

while this really is only a debug function, ensuring that no uninitialized heap content ends up in padding in the structure and thus to disk is good practice.

Change-Id I7f4c7b0ca748975defca1e5104e7077a761cd49c

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1323
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33983.html

---
M src/openvpn/packet_id.c

1 file changed, 1 insertion(+), 0 deletions(-)
src/openvpn/packet_id.c +1 -0
index 880eee1..08d9d9b 100644
@@ -511,6 +511,7 @@
         && (p->time != p->time_last_written || p->id != p->id_last_written))
     {
         struct packet_id_persist_file_image image;
+        CLEAR(image);
         ssize_t n;
         off_t seek_ret;
         struct gc_arena gc = gc_new();

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1323?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I7f4c7b0ca748975defca1e5104e7077a761cd49c
Gerrit-Change-Number: 1323
Gerrit-PatchSet: 2
Gerrit-Owner: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>